package com.xm.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;


@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserTaskInfo {
    private String userName;
    private String heartPrice;
    private String goodName;
    private String subType;
    private String taskId;

    // 构造方法、getter和setter
    public UserTaskInfo(String userName, String heartPrice, String goodName, String subType) {
        this.userName = userName;
        this.heartPrice = heartPrice;
        this.subType = subType;
        this.goodName = goodName;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserTaskInfo that = (UserTaskInfo) o;
        return Objects.equals(taskId, that.taskId); // 假设 taskId 是唯一标识
    }

    @Override
    public int hashCode() {
        return Objects.hash(taskId); // 必须和 equals() 保持一致
    }
}